package exception;

import java.io.IOException;

interface I2 {
    void test() throws IOException;
}

class T2 implements I2 {

    @Override
    public void test() {
        System.out.println("test");
    }
}

/**
 * 继承或者实现一个类。抛出异常
 */
public class ExtendsDemo {
    public static void main(String[] args) {
        T2 t2 = new T2();
        t2.test();

        I2 i2 = t2;
        try {
            i2.test();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
